package com.yb.oldlearning;

public class Sleeper extends Thread{
	private int duration;
	public Sleeper(String name ,int sleepTime){
		super(name);
		this.duration = duration;
		start();
	}
	
	public void run(){
		try {
			sleep(duration);
		} catch (InterruptedException e) {
			System.out.println(getName() + " was interrupted." + " isInterrupted():" + isInterrupted());
			e.printStackTrace();
			return;
		}
		System.out.println(getName() + " has awakend");
	}
	
	
}
